<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
	<meta http-equiv="Cache-Control" content="no-siteapp"/>
	<link rel="Bookmark" href="imgs/bai.ico">
	<link rel="Shortcut Icon" href="imgs/bai.ico"/>
	<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
	<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
	<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
	<title>管理后台</title>
	<style type="text/css">
	</style>
</head>
<body>
<!--顶部-->
<header class="navbar-wrapper"></header>
<!--左侧菜单-->
<aside class="Hui-aside">
	<div class="menu_dropdown bk_2" id="leftMenu"></div>
</aside>

<!--右侧内容框架-->
<section class="Hui-article-box">
	<nav class="breadcrumb">
		<a href="index.html" class="maincolor">
			<i class="Hui-iconfont">&#xe67f;</i>
			首页
		</a>
		<span class="c-gray en">&gt;</span> 服务管理
		<span class="c-gray en">&gt;</span> <span id="typeTitle"></span>
	</nav>
	<div class="Hui-article">
		<article class="cl pd-20">
			<div class="cl pd-5 bg-1 bk-gray">
				<span class="l">
					<a href="fuwu.html?type=1" class="btn btn-primary radius">
						家政蒸洗
					</a>
					<a href="fuwu.html?type=2" class="btn btn-primary radius">
						网页小程序
					</a>
					<a href="fuwu.html?type=3" class="btn btn-primary radius">
						剪辑合成
					</a>
				</span>
			</div>
			<div class="cl pd-5 bg-1 bk-gray">
				<span class="l">
					<a href="javascript:;" class="btn btn-primary radius" onclick="lay_add('添加','fuwu-edit.html', 0);">
						<i class="Hui-iconfont">&#xe600;</i>
						添加
					</a>
					<span id="xcx">
						<!--<a href="" class="btn btn-primary radius">小程序关</a>-->
					</span>
				</span>
				<span class="r">共有数据：<strong id="pageTotal">0</strong> 条</span>
			</div>
			<div class="mt-20">
				<table class="table table-border table-bordered table-hover table-bg table-sort">
					<thead>
					<tr class="text-c">
						<th>ID</th>
						<!--<th>发布人</th>-->
						<th>标题</th>
						<th>分类</th>
						<th>封面图</th>
						<th>价格</th>
						<th>内容</th>
						<th>最近时间</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
				<div id="pageHtml"></div>
			</div>
		</article>
	</div>
</section>

<!-- msg弹窗 -->
<span id="msgPop"></span>
</body>
</html>


<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.page.js"></script>
<script type="text/javascript" src="js/view.js"></script>
<script type="text/javascript" src="js/fuwu.js"></script>
<script type="text/javascript">
	var formList = [];
	var pages = {
		start: 1, limit: pageSize,
		url: '/admin/fuwu.html',
	};
	var type = getParamByUrl('type');
	(function () {
		if (type == '') {
			window.location.href = pages.url + '?type=1';
		}
		configOne();
		getIndex();
	})();
	//获取配置
	function configOne(){
		$.ajax({
			type: apis.fuwuConfigOne.method,
			url: apis.fuwuConfigOne.url,
			data: {},
			success: function (res) {
				console.log(res);
				if (res.code < 0) {
					return
				}
				var d = res.data;
				var h = '';
				if (d.iswx == 1) {
					h = '<a href="javascript:;" class="btn btn-primary radius" onclick="configSet(0);">小程序关</a>';
				} else {
					h = '<a href="javascript:;" class="btn btn-primary radius" onclick="configSet(1);">小程序开</a>';
				}
				$('#xcx').html(h);
			},
			error: function () {
				console.log('网络错误');
			}
		});
	}
	function configSet(v){
		$.ajax({
			type: apis.fuwuConfigModify.method,
			url: apis.fuwuConfigModify.url,
			data: { iswx: v },
			success: function (res) {
				console.log(res);
				if (res.code < 0) {
					return
				}
				layerMsgOk('操作成功');
				configOne();
			},
			error: function () {
				console.log('网络错误');
			}
		});
	}
</script>